var stream = require('stream')
var fs = require('fs')
// 创建了一个可读流
var readStream = fs.createReadStream('./test.txt', 'utf-8')
readStream.on('data', data => {
  console.log('data', data)
})
readStream.on('close', () => console.log('close'))
readStream.on('error', () => {
  console.log('error')
})